home *** CD-ROM | disk | FTP | other *** search
- -- Shared scripts for Brief History
-
-
-
- -- This starts the voiceOver that is in the variable currentVoice
- on PlayVoice
- global voicePath, currentVoice
- sound stop 1
- if currentVoice = "" then
- exit
- end if
- --put voicePath¤tVoice
- sound playFile 1,voicePath¤tVoice
- -- sound fadeIn 1, 1
- --checkDOS currentVoice no longer needed. ΓÇó gkg 9/16/94
- end PlayVoice
-
-
- -- This determines if the background sound is currently playing, and starts
- -- it again if it's not
- on PlaySoundTrack
- global soundTrackPath,currentsoundTrack
- if (soundBusy(2)) then exit
- sound playFile 2,soundTrackPath¤tsoundTrack
- --checkDOS currentsoundTrack --no longer needed. ΓÇó gkg 9/16/94
- -- Updatestage -- REMOVED by TRS 9/11/94 (No reason for it)
- end PlaySoundTrack
-
-
- -- When the spacebar is hit, the volume controls pop on and off the screen
- on ToggleVolumeWindow
- global vWindow,vSlider1,vSlider2,volumeHPositions
- if the left of sprite vWindow > 641 then
- set the locH of sprite vWindow to value(item 1 of volumeHPositions)
- set the locH of sprite vSlider1 to value(item 2 of volumeHPositions)
- set the locH of sprite vSlider2 to value(item 3 of volumeHPositions)
- updateStage
- else
- set the locH of sprite vWindow to 12000
- set the locH of sprite vSlider1 to 12000
- set the locH of sprite vSlider2 to 12000
- updateStage
- end if
- end ToggleVolumeWindow
-
-
- -- Drag a slider when the mouse is clicked and held down on it
- on DragSlider whichOne
- global sliderTop,sliderBottom
- put (the locV of sprite whichOne) - the mouseV into vOffset
- repeat while the stillDown
- if (the mouseV >= sliderTop) AND (the mouseV <= sliderBottom) then
- set the locV of sprite whichOne = (the mouseV + vOffset)
- updateStage
- end if
- end repeat
- SetSliderLevel(whichOne)
- end DragSlider
-
-
- -- This figures out where the slider should be on the scale based on the level of the sound channel
- on SetSliderVolume whichChannel
- global sliderTop,sliderBottom,vSlider1,vSlider2,ambientLevel,voiceLevel
- if whichChannel = vSlider1 then
- put 1 into channelNum
- else
- put 2 into channelNum
- end if
- put 255 into volumeTop
- put sliderBottom - sliderTop into range
- put the volume of sound channelNum into howLoud
- set the locV of sprite whichChannel = sliderBottom - integer((range * howLoud) / volumeTop)
- updateStage
- end SetSliderVolume
-
-
- -- This determines what the volume should be based on the level of the slider
- on SetSliderLevel whichSlider
- global sliderTop,sliderBottom,vSlider1,vSlider2,ambientLevel,voiceLevel
- put sliderBottom - sliderTop into range
- put (sliderBottom - (the locV of sprite whichSlider)) into where
- put float(where) / range into where
- put integer(where * 255) into sliderV
- if whichSlider = vSlider1 then
- set the volume of sound 1 to sliderV
- put sliderV into voiceLevel
- else
- set the volume of sound 2 to sliderV
- put sliderV into ambientLevel
- end if
- updateStage
- end SetSliderLevel
-
-
- -- This makes the sound controls visible and invisible if the spacebar is pressed
- on keyCheck
- if the key = " " then ToggleVolumeWindow
- end keyCheck
-
-
- on soundSetup
- -- globals used
- global voicePath,soundTrackPath,currentVoice,currentsoundTrack
- global vWindow,vSlider1,vSlider2,sliderTop,sliderBottom,volumeHPositions
- global ambientLevel, voiceLevel
-
- -- voicePath: Variable holding the path to the voice sound folder
- -- currentVoice: Variable holding the name of the currently playing voiceover file
- -- soundTrackPath: Variable holding the path to the sound folder
- -- currentsoundTrack: Variable holding the name of the currently playing ambient file
- -- ambientLevel: Current volume for sound channel 1
- -- voiceLevel: Current volume for sound channel 2
- -- vWindow: Volume window sprite channel
- -- vSlider1: Channel number for slider for volume of voice
- -- vSlider2: Channel number for slider for volume of ambient sound
- -- sliderTop: The vertical coordinate of the top of the volume controls
- -- sliderBottom: The vertical coordinate of the bottom of the volume controls
- -- volumeHPositions: The horizontal coordinates of the 3 volume elements
-
- -- The following 3 variables can be whatever you'd like
- -- This initializes the global variable that references the channel
- -- for the volume slider background
- put 46 into vWindow
- -- This initializes the slider for controlling the level of sound 1
- put 47 into vSlider1
- -- This initializes the slider for controlling the level of sound 2
- put 48 into vSlider2
- -- The next 2 lines determine the top and bottom for the range on the slider controls
- put (the top of sprite vWindow) + 26 into sliderTop
- put (the bottom of sprite vWindow) - 32 into sliderBottom
- -- These are the horizontal coordinates of all the volume controls when on the stage
- -- The first is the slider background, then the left slider, and the right
- -- You can alter the vertical coordinates, and change these to suite your artwork
- put "320,302,338" into volumeHPositions
-
- -- This loads the variable holding the current sound level for each channel
- set the volume of sound 2 to ambientLevel
- set the volume of sound 1 to voiceLevel
- -- This actually sets the level of the slider on the controller
- SetSliderVolume(vSlider1)
- SetSliderVolume(vSlider2)
- -- Start the background sound playing
- --PlaySoundTrack
-
- -- test
- -- take this out for now
- --PlayVoice
- -- Check to see if any keys are pressed, especially the space bar
- when keyDown then keyCheck
-
- -- Place into score where multiple voice overs are used on successive frames
- -- put "voiceIntro" into currentVoice
- -- PlayVoice
- end soundSetup
-
- on ClearPuppets
- repeat with i = 1 to 44
- puppetSprite i, False
- end repeat
- end
-
- on stopmovie
- global gFlyThru, gCraftBefore
- repeat with i = 1 to 40
- puppetSprite i, False
- end repeat
- set gFlyThru = 2
- set gCraftBefore = False
- set the timeoutScript to "nothing"
- clearPuppets
- sound stop 1
- sound FadeOut 2, 1*60
- sound FadeIn 2, 1*60
- end
-
-
- on NextScreen
- clearPuppets
- sound stop 1
- unload
- set lFrame1 = marker(1)
- set lFrame2 = (marker(2) - 1)
- preload lFrame1, lFrame2
- end
-
- on EndOfSceneFrame lFrame
- global gWaitForUser
- if gWaitForUser = False then
- go to the frame
- else
- if soundBusy(1) = True then
- go to the frame
- else
- NextScreen
- go to frame lFrame
- end if
- end if
- end
-
- on EndOfScene
- global gWaitForUser
- if gWaitForUser = False then
- go to the frame
- else
- if soundBusy(1) = True then
- go to the frame
- else
- NextScreen
- go to marker(1)
- end if
- end if
- end
-
- on EndOfSceneWithLoop
- global gWaitForUser
- if (the frame + 1) = marker(1) then
- if gWaitForUser = False then
- go to frame (marker(0) + 1)
- else
- if soundBusy(1) = True then
- go to frame (marker(0) + 1)
- else
- NextScreen
- go to marker(1)
- end if
- end if
- else
- if gWaitForUser = False then
- go to (the frame + 1)
- else
- if soundBusy(1) = True then
- go to (the frame + 1)
- else
- NextScreen
- go to marker(1)
- end if
- end if
- end if
- end
-
- on EndOfSceneWithLoopMovie lMovie
- global gWaitForUser
- if (the frame + 1) = marker(1) then
- if gWaitForUser = False then
- go to frame (marker(0) + 1)
- else
- if soundBusy(1) = True then
- go to frame (marker(0) + 1)
- else
- ClearPuppets
- puppetSprite 45, False
- go movie lmovie
- end if
- end if
- else
- if gWaitForUser = False then
- go to (the frame + 1)
- else
- if soundBusy(1) = True then
- go to (the frame + 1)
- else
- ClearPuppets
- puppetSprite 45, False
- go movie lMovie
- end if
- end if
- end if
- end
-
- on EndOfSceneFinal
- global gWaitForUser
- if gWaitForUser = False then
- go to the frame
- else
- if soundBusy(1) = True then
- go to the frame
- else
- NextScreen
- go to frame "enter" of movie "Main"
- end if
- end if
- end
-
- on EndOfSceneFinalWithLoop
- global gWaitForUser
- if (the frame + 1) = marker(1) then
- if gWaitForUser = False then
- go to frame (marker(0) + 1)
- else
- if soundBusy(1) = True then
- go to frame (marker(0) + 1)
- else
- ClearPuppets
- puppetSprite 45, False
- go to frame "Enter" of movie "Main"
- end if
- end if
- else
- if gWaitForUser = False then
- go to (the frame + 1)
- else
- if soundBusy(1) = True then
- go to (the frame + 1)
- else
- ClearPuppets
- puppetSprite 45, False
- go to frame "Enter" of movie "Main"
- end if
- end if
- end if
- end
-
-
- on EndOfSceneMovie lmovie
- global gWaitForUser
- if gWaitForUser = False then
- go to the frame
- else
- if soundBusy(1) = True then
- go to the frame
- else
- ClearPuppets
- puppetSprite 45, False
- go to movie lmovie
- end if
- end if
- end
-
-
- on NextScreenFrame lFrame
- clearPuppets
- sound stop 1
- unload
- set lFrame1 = lFrame
- go to lFrame
- set lFrame2 = (marker(1) - 1)
- preload lFrame1, lFrame2
- end
-
-
-
- on EndOfSceneWithQT lSpriteNumber
- global gWaitForUser
- if the movieTime of sprite lSpriteNumber ¬
- < the stopTime of sprite lSpriteNumber then
- go to the frame
- exit
- else
- if gWaitForUser = False then
- go to the frame
- else
- NextScreen
- set the movieTime of sprite lSpriteNumber = 0
- set the movieRate of sprite lSpriteNumber = 0
- go to marker(1)
- end if
- end if
- end
-
- on ResetQT lSpriteNumber
- set the movieTime of sprite lSpriteNumber = 0
- set the movieRate of sprite lSpriteNumber = 0
- end
-
-
- on EndOfSceneMovieWithQT lSpriteNumber, lmovie
- global gWaitForUser
- if the movieTime of sprite lSpriteNumber ¬
- < the stopTime of sprite lSpriteNumber then
- go to the frame
- exit
- else
- if gWaitForUser = False then
- go to the frame
- else
- NextScreen
- set the movieTime of sprite lSpriteNumber = 0
- set the movieRate of sprite lSpriteNumber = 0
- ClearPuppets
- puppetSprite 45, False
- go movie lmovie
- end if
- end if
- end
-
-
- on waitNew lamount
- starttimer
- repeat while the timer < (lamount * 60)
- nothing
- end repeat
- end
-
-
- -- Error checking code to determine DOS file name compatibility. ΓÇó DKA 9/11/94
- on checkDOS SoundFileName
- set x = offset (".", SoundFileName)
- put "Sound name:" && SoundFileName && " Name length ="&&string(x-1)
- if x > 9 then alert "Name too long"
- end
-
- --looks for above 8 bit bitmaps. ΓÇó gkg 9/14/94
- on checkColor
- repeat with x = 1 to 1200
- if the castType of cast x = #bitmap then
- if the depth of cast x > 8 then
- alert "Crummy Cast" && "at cast" && string(x)
- end if
- end if
- end repeat
- end
-
- --checks inks of sprites on currentframeΓÇó gkg 9/16/94
-
- on checkInks
- repeat with x = 1 to 30
- set i = the ink of sprite x
- if i <> 0 then
- put "sprite" && x && "uses ink effect:" && i
- end if
- end repeat
- end
-